{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e1df5748-2506-4511-9fde-3e99591186d4",
   "metadata": {},
   "outputs": [],
   "source": [
    "%pip install jupyter_ui_poll fastparquet anywidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "90ebc442-0918-4fb7-b561-409968fc16d9",
   "metadata": {},
   "outputs": [],
   "source": [
    "from io import StringIO, BytesIO\n",
    "import time \n",
    "\n",
    "from IPython.display import Javascript\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "import anywidget\n",
    "import traitlets\n",
    "\n",
    "#import buckaroo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4cec8236-3910-4763-8ea4-4fd65930bd17",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       a\n",
       "0  False\n",
       "1   True"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bool_df = pd.DataFrame([{'a':False}, {'a':True}])\n",
    "bool_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6192ae35-2d74-419a-8fdf-dc9e8f9b087d",
   "metadata": {},
   "outputs": [],
   "source": [
    "numeric_columns = pd.DataFrame([['foo', 8], ['bar',23]])\n",
    "# older json based Buckaroo works with numeric columns\n",
    "# BuckarooInfiniteWidget - the new default - which uses parquet doesn't\n",
    "#buckaroo.BuckarooWidget(numeric_columns) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "9ffa162d-e1b9-4203-87a4-982ab6e75702",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>{'foo': 9, 'bar': 10}</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>{'foo': 3, 'bar': 5}</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       a\n",
       "0  {'foo': 9, 'bar': 10}\n",
       "1   {'foo': 3, 'bar': 5}"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#continguous\n",
    "object_values = pd.DataFrame([\n",
    "    {'a':{'foo':9, 'bar':10}},\n",
    "    {'a':{'foo':3, 'bar':5}}])\n",
    "object_values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "2fd2301b-5d4b-4843-afd1-ce34586b47b0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>{'foo': 9, 'qux': 10}</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>{'foo': 3, 'bar': 5}</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       a\n",
       "0  {'foo': 9, 'qux': 10}\n",
       "1   {'foo': 3, 'bar': 5}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#different key names\n",
    "object_values_varied = pd.DataFrame([\n",
    "    {'a':{'foo':9, 'qux':10}},\n",
    "    {'a':{'foo':3, 'bar':5}}])\n",
    "object_values_varied"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "fc3d205c-b6e4-48d9-9b73-b958c05bd06c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a    datetime64[ns]\n",
      "dtype: object\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2025-03-01 09:19:35.732574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2014-01-02 00:00:00.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                           a\n",
       "0 2025-03-01 09:19:35.732574\n",
       "1 2014-01-02 00:00:00.000000"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "date_values = pd.DataFrame([{'a':pd.Timestamp('now')},\n",
    "                            {'a':pd.Timestamp('2014-01-02')}])\n",
    "print(date_values.dtypes)\n",
    "date_values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e5565fa8-1db7-4f51-84dd-ad2fe35fd1eb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-inf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>inf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-9.223372e+18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>9.223372e+18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              a\n",
       "0           NaN\n",
       "1          -inf\n",
       "2           inf\n",
       "3 -9.223372e+18\n",
       "4  9.223372e+18"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "odd_integer_values = pd.DataFrame([\n",
    "    {'a':np.nan},\n",
    "    {'a':np.inf * -1},\n",
    "    {'a':np.inf},\n",
    "    {'a':np.iinfo(np.int64).min},\n",
    "    {'a':np.iinfo(np.int64).max},\n",
    "])\n",
    "odd_integer_values    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "3cc5d541-37a1-453a-b290-40f77f4371f6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-inf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>inf</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-9.223372e+18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>9.223372e+18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              a\n",
       "0           NaN\n",
       "1          -inf\n",
       "2           inf\n",
       "3 -9.223372e+18\n",
       "4  9.223372e+18"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "over_64 = pd.DataFrame([\n",
    "    {'a':np.nan},\n",
    "    {'a':np.iinfo(np.int64).min * 2},\n",
    "    {'a':np.iinfo(np.int64).max * 2},\n",
    "])\n",
    "odd_integer_values    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "fa00200b-8b7f-4c1d-9f6b-ba8058360419",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[10, 20, 30]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>[30, 20, 40]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              a\n",
       "0  [10, 20, 30]\n",
       "1  [30, 20, 40]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lists_df = pd.DataFrame([\n",
    "    {'a': [10, 20, 30]},\n",
    "    {'a': [30, 20, 40]}])\n",
    "lists_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "a412f8bd-7b4a-44bb-b440-37a951d90906",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[10, 20, 30]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>[30, 40]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              a\n",
       "0  [10, 20, 30]\n",
       "1      [30, 40]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "uneven_lists_df = pd.DataFrame([\n",
    "    {'a': [10, 20, 30]},\n",
    "    {'a': [30, 40]}])\n",
    "uneven_lists_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "78d00791-403a-49bf-8706-4810bb22886e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>b</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>b</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>c</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a\n",
       "0  a\n",
       "1  b\n",
       "2  c\n",
       "3  a\n",
       "4  b\n",
       "5  c"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "categorical_df = pd.DataFrame({'a': pd.Categorical(['a', 'b', 'c', 'a', 'b', 'c'])})\n",
    "categorical_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "881977de-fca5-4b45-8220-77b4371ac758",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "        a\n",
      "foo 3  10\n",
      "    4  20\n",
      "bar 3  30\n",
      "    4  40\n",
      "    5  50\n"
     ]
    }
   ],
   "source": [
    "multi_index_rows = pd.DataFrame(\n",
    "    [{'a':10}, {'a':20}, {'a':30}, {'a':40}, {'a':50}],\n",
    "    index=pd.MultiIndex.from_tuples(\n",
    "        [('foo', 3), ('foo', 4), ('bar', 3), ('bar', 4), ('bar', 5)]))\n",
    "multi_index_columns = multi_index_rows.T\n",
    "print(multi_index_rows) #Buckaroo doesn't work with multi indexes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "eff20128-791e-4fdc-8104-17edbff68930",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "      a\n",
      "foo  10\n",
      "bar  20\n"
     ]
    }
   ],
   "source": [
    "string_index = pd.DataFrame([{'a':10}, {'a':20}], index=[\"foo\", \"bar\"])\n",
    "print(string_index) # Buckaroo doesn't like string indexes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d7b2eeb0-c94d-41e9-8f93-863414c4afc6",
   "metadata": {},
   "outputs": [],
   "source": [
    "mixed_bool_str = pd.DataFrame([\n",
    "    {'a': 'a string'},\n",
    "    {'a': True},\n",
    "    {'a': False}])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "1cdca5f9-626e-443b-8548-6edf32fa94e3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "80c613b126c9485e977ad12ceb475109",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15\\x1e\\x15\",\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00\\x0f8\\x02\\x…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "def bucakroo_to_parquet(df):\n",
    "    obj_columns = df.select_dtypes([pd.CategoricalDtype(), 'object']).columns.to_list()\n",
    "    encodings = {k:'json' for k in obj_columns}\n",
    "    return df.to_parquet(engine='fastparquet', object_encoding=encodings)\n",
    "    pd.read_parquet(BytesIO(mixed_bool_str.to_parquet(engine='fastparquet', object_encoding={'a':'bson'})), engine='fastparquet')\n",
    "\n",
    "class SerializationWidget(anywidget.AnyWidget):\n",
    "    _esm = \"\"\"\n",
    "    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n",
    "    function render({ model, el }) {\n",
    "      console.log(\"hyparquet\", hyparquet)\n",
    "\n",
    "        const table_bytes = model.get(\"df_parquet\")\n",
    "        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n",
    "        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n",
    "        console.log(\"metadata\", metadata)\n",
    "        hyparquet.parquetRead({\n",
    "            file: table_bytes.buffer,\n",
    "            metadata:metadata,\n",
    "            rowFormat: 'object',\n",
    "            onComplete: data => {\n",
    "                const parqData = data;\n",
    "                console.log(\"parqData\", parqData)\n",
    "                model.set(\"df_json\", data)\n",
    "                model.save_changes();\n",
    "            }\n",
    "      })\n",
    "    }\n",
    "    export default { render };\n",
    "    \"\"\"\n",
    "    df_parquet = traitlets.Bytes().tag(sync=True)\n",
    "    df_json = traitlets.Any().tag(sync=True)\n",
    "\n",
    "cw = SerializationWidget(df_parquet=bucakroo_to_parquet(bool_df))\n",
    "display(cw)\n",
    "#check the javascript console to see what cw logged"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "d54e9994-c296-488b-8e08-8defd137e3ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "13dcba4a77bf48be84819fa795fb6e35",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15\\x1e\\x15\",\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00\\x0f8\\x02\\x…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       a\n",
       "0  False\n",
       "1   True"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from jupyter_ui_poll import ui_events\n",
    "#adapted from  https://stackoverflow.com/questions/54629964/how-to-pause-jupyter-notebook-widgets-waiting-for-user-input\n",
    "\n",
    "def rountrip_widget_df(df):\n",
    "    \"\"\" just returns the df \"\"\"\n",
    "    try:\n",
    "        cw2 = SerializationWidget(df_parquet=bucakroo_to_parquet(df))\n",
    "        display(Javascript(\"console.clear()\"))\n",
    "        display(cw2)\n",
    "        with ui_events() as poll:\n",
    "            while cw2.df_json is None:\n",
    "                #waiting for user input\n",
    "                time.sleep(.1)\n",
    "                poll(1) # poll queued UI events including button\n",
    "                pass\n",
    "        return pd.DataFrame(cw2.df_json)\n",
    "    except:\n",
    "        return \"error\"\n",
    "rountrip_widget_df(bool_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "c8bcfdeb-6916-4b79-8ea4-540918aa496b",
   "metadata": {},
   "outputs": [],
   "source": [
    "def roundtrip_json(df):\n",
    "    return df.equals(pd.read_json(StringIO(df.to_json())))\n",
    "def roundtrip_feather(df):\n",
    "    byts = BytesIO()\n",
    "    try:\n",
    "        df.to_feather(byts)\n",
    "        return df.equals(pd.read_feather(byts))\n",
    "    except:\n",
    "        return \"error\"\n",
    "def roundtrip_parquet(df):\n",
    "    try:\n",
    "        return df.equals(pd.read_parquet(BytesIO(df.to_parquet())))\n",
    "    except:\n",
    "        return \"error\"\n",
    "def roundtrip_fastparquet(df):\n",
    "    try:\n",
    "        return df.equals(pd.read_parquet(BytesIO(df.to_parquet(engine='fastparquet')), engine='fastparquet'))\n",
    "    except:\n",
    "        return \"error\"\n",
    "\n",
    "def roundtrip_fastparquet_json(df):\n",
    "    try:\n",
    "        out = BytesIO(df.to_parquet(engine='fastparquet', object_encoding={'a': 'json'}))\n",
    "        return df.equals(pd.read_parquet(out, engine='fastparquet'))\n",
    "    except:\n",
    "        return \"error\"\n",
    "def rountrip_widget_test(df):\n",
    "    try:\n",
    "        return df.equals(rountrip_widget_df(df))\n",
    "    except:\n",
    "        return \"error\"\n",
    "def roundtrip_pickle(df):\n",
    "    df.to_pickle('byts')\n",
    "    return df.equals(pd.read_pickle('byts'))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "3617255d-deed-4286-bf54-ff57aba87630",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "643e614ccb6b4c4f9bce16d8d092d615",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15\\x1e\\x15\",\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00\\x0f8\\x02\\x…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "dd6ddb6a5bff404e92e190d43829ff40",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15r\\x15`,\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x009p\\x02\\x00\\x00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ec6bc3c50a994d59ba15002f17037e9f",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15r\\x15h,\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x009p\\x02\\x00\\x00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b23a2a4e15bc48a7a187fcea6a8a857f",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15<\\x15@,\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00\\x1et\\x02\\x00\\…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "21e1504d63b54e85a189e54a43dc2421",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15\\\\\\x15J,\\x15\\n\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00.\\x18\\x02\\x00\\x…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "61cc76c9a3e14a38b3a0d30a2cd8ae15",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15T\\x15P,\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00*L\\x02\\x00\\x00…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "7e544c6bf4ae47f5a440d9f34186a30f",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15N\\x15P,\\x15\\x04\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00\\'P\\x02\\x00\\x0…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "e832fe180b6a460db8b7495717d3892d",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x00\\x15Z\\x15^,\\x15\\x06\\x15\\x00\\x15\\x06\\x15\\x08\\x00\\x00-\\xb0\\x02\\x00\\…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "console.clear()"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a5cf8ec5da7743328c9b776812fc1581",
       "version_major": 2,
       "version_minor": 1
      },
      "text/plain": [
       "SerializationWidget(df_parquet=b'PAR1\\x15\\x04\\x15*\\x15.L\\x15\\x06\\x15\\x00\\x00\\x00\\x15P\\x03\\x00\\x00\\x00\"a\"\\x03\\x…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>json</th>\n",
       "      <th>feather</th>\n",
       "      <th>fast_parquet_json</th>\n",
       "      <th>widget</th>\n",
       "      <th>parquet</th>\n",
       "      <th>fast_parquet</th>\n",
       "      <th>pickle</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>numeric_columns</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>bool_df</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>object_values</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>object_values_varied</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>date_values</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>odd_integer_values</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>lists_df</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>uneven_lists_df</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>multi_index_rows</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>multi_index_columns</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>mixed_bool_str</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>error</td>\n",
       "      <td>error</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>categorical_df</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                    name   json feather fast_parquet_json  widget parquet  \\\n",
       "0        numeric_columns   True    True             error   False    True   \n",
       "1                bool_df   True    True              True    True    True   \n",
       "2          object_values   True    True              True    True    True   \n",
       "3   object_values_varied   True   False              True    True   False   \n",
       "4            date_values  False    True              True   False    True   \n",
       "5     odd_integer_values  False    True              True   False    True   \n",
       "6               lists_df   True   False              True    True   False   \n",
       "7        uneven_lists_df   True   False              True    True   False   \n",
       "8       multi_index_rows  False    True             error   False    True   \n",
       "9    multi_index_columns  False    True             error   False    True   \n",
       "10        mixed_bool_str   True   error              True    True   error   \n",
       "11        categorical_df  False    True              True   False    True   \n",
       "\n",
       "   fast_parquet  pickle  \n",
       "0         error    True  \n",
       "1          True    True  \n",
       "2          True    True  \n",
       "3          True    True  \n",
       "4          True    True  \n",
       "5          True    True  \n",
       "6          True    True  \n",
       "7          True    True  \n",
       "8         error    True  \n",
       "9         error    True  \n",
       "10        error    True  \n",
       "11         True    True  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfs = dict(\n",
    "    numeric_columns = numeric_columns,\n",
    "    bool_df=bool_df,\n",
    "    object_values = object_values,\n",
    "    object_values_varied = object_values_varied,\n",
    "    date_values = date_values,\n",
    "    odd_integer_values = odd_integer_values,\n",
    "    lists_df = lists_df,\n",
    "    uneven_lists_df = uneven_lists_df,\n",
    "    multi_index_rows = multi_index_rows,\n",
    "    multi_index_columns = multi_index_columns,\n",
    "    mixed_bool_str = mixed_bool_str,\n",
    "    categorical_df = categorical_df)\n",
    "results = []\n",
    "for k, df in dfs.items():\n",
    "    results.append({\n",
    "        'name':k,\n",
    "        'json':roundtrip_json(df), 'feather':roundtrip_feather(df),\n",
    "        'fast_parquet_json':roundtrip_fastparquet_json(df),\n",
    "        'widget': rountrip_widget_test(df),\n",
    "\n",
    "        'parquet':roundtrip_parquet(df),\n",
    "        'fast_parquet':roundtrip_fastparquet(df), \n",
    "        'pickle': roundtrip_pickle(df), \n",
    "                   })\n",
    "#results_df = pd.DataFrame(results, index=dfs.keys())\n",
    "results_df = pd.DataFrame(results) #Buckaroo doesn't work with string indexes\n",
    "results_df"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.1"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {
     "0248f5a938924d7a8dc882330561f776": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "13dcba4a77bf48be84819fa795fb6e35": {
      "buffers": [
       {
        "data": "UEFSMRUAFR4VIiwVBBUAFQYVCAAADzgCAAAABAECAAAAAAAAAAAVAhksSAZzY2hlbWEVAgAVABUCFQIYAWEAFgQZHBkcJggcFQAZFQAZGAFhFQIWBBZAFkQZABYIPDYAABkcFQAVABUCAAAAFkAWBAAZHBgGcGFuZGFzGLkDeyJjb2x1bW5faW5kZXhlcyI6IFt7ImZpZWxkX25hbWUiOiBudWxsLCAibWV0YWRhdGEiOiBudWxsLCAibmFtZSI6IG51bGwsICJudW1weV90eXBlIjogIm9iamVjdCIsICJwYW5kYXNfdHlwZSI6ICJtaXhlZC1pbnRlZ2VyIn1dLCAiY29sdW1ucyI6IFt7ImZpZWxkX25hbWUiOiAiYSIsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogImEiLCAibnVtcHlfdHlwZSI6ICJib29sIiwgInBhbmRhc190eXBlIjogImJvb2wifV0sICJjcmVhdG9yIjogeyJsaWJyYXJ5IjogImZhc3RwYXJxdWV0IiwgInZlcnNpb24iOiAiMjAyNC4xMS4wIn0sICJpbmRleF9jb2x1bW5zIjogW3sia2luZCI6ICJyYW5nZSIsICJuYW1lIjogbnVsbCwgInN0YXJ0IjogMCwgInN0ZXAiOiAxLCAic3RvcCI6IDJ9XSwgInBhbmRhc192ZXJzaW9uIjogIjIuMi4zIiwgInBhcnRpdGlvbl9jb2x1bW5zIjogW119ABguZmFzdHBhcnF1ZXQtcHl0aG9uIHZlcnNpb24gMjAyNC4xMS4wIChidWlsZCAwKQBDAgAAUEFSMQ==",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": false
        },
        {
         "a": true
        }
       ],
       "layout": "IPY_MODEL_aa8dc28dba5b42c5b90d93e06cb45406"
      }
     },
     "21e1504d63b54e85a189e54a43dc2421": {
      "buffers": [
       {
        "data": "UEFSMRUAFVwVSiwVChUAFQYVCAAALhgCAAAAAx4ABQEE8P8FBwgA8H8JCATgww0IIEMAAAAAAAAAABUCGSxIBnNjaGVtYRUCABUKFYABFQIYAWEAFgoZHBkcJggcFQoZFQAZGAFhFQIWChZ+FmwZABYIPBgIAAAAAAAA8H8YCAAAAAAAAPD/FgIAGRwVABUAFQIAAAAWfhYKABkcGAZwYW5kYXMYvwN7ImNvbHVtbl9pbmRleGVzIjogW3siZmllbGRfbmFtZSI6IG51bGwsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogbnVsbCwgIm51bXB5X3R5cGUiOiAib2JqZWN0IiwgInBhbmRhc190eXBlIjogIm1peGVkLWludGVnZXIifV0sICJjb2x1bW5zIjogW3siZmllbGRfbmFtZSI6ICJhIiwgIm1ldGFkYXRhIjogbnVsbCwgIm5hbWUiOiAiYSIsICJudW1weV90eXBlIjogImZsb2F0NjQiLCAicGFuZGFzX3R5cGUiOiAiZmxvYXQ2NCJ9XSwgImNyZWF0b3IiOiB7ImxpYnJhcnkiOiAiZmFzdHBhcnF1ZXQiLCAidmVyc2lvbiI6ICIyMDI0LjExLjAifSwgImluZGV4X2NvbHVtbnMiOiBbeyJraW5kIjogInJhbmdlIiwgIm5hbWUiOiBudWxsLCAic3RhcnQiOiAwLCAic3RlcCI6IDEsICJzdG9wIjogNX1dLCAicGFuZGFzX3ZlcnNpb24iOiAiMi4yLjMiLCAicGFydGl0aW9uX2NvbHVtbnMiOiBbXX0AGC5mYXN0cGFycXVldC1weXRob24gdmVyc2lvbiAyMDI0LjExLjAgKGJ1aWxkIDApAF4CAABQQVIx",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": null
        },
        {
         "a": null
        },
        {
         "a": null
        },
        {
         "a": -9223372036854776000
        },
        {
         "a": 9223372036854776000
        }
       ],
       "layout": "IPY_MODEL_36ee686ab2534f91a7f0925869c8633d"
      }
     },
     "36ee686ab2534f91a7f0925869c8633d": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "405ce72438ab4bc3b73cfb7037aac158": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "46927f70486f4fb7862a2d826b3f356b": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "4c3828c9f5cc461ca72c9e2c7b21c1ba": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "4c9e32ab556d4753b437dcd4d249445d": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "61cc76c9a3e14a38b3a0d30a2cd8ae15": {
      "buffers": [
       {
        "data": "UEFSMRUAFVQVUCwVBBUAFQYVCAAAKkwCAAAABAEKAAAAWzEwLDIwLDMwXQUOADMFDig0MF0AAAAAAAAAABUCGSxIBnNjaGVtYRUCABUMJQIYAWElJgAWBBkcGRwmCBwVDBkVABkYAWEVAhYEFnYWchkAFgg8NgAAGRwVABUAFQIAAAAWdhYEABkcGAZwYW5kYXMYvQN7ImNvbHVtbl9pbmRleGVzIjogW3siZmllbGRfbmFtZSI6IG51bGwsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogbnVsbCwgIm51bXB5X3R5cGUiOiAib2JqZWN0IiwgInBhbmRhc190eXBlIjogIm1peGVkLWludGVnZXIifV0sICJjb2x1bW5zIjogW3siZmllbGRfbmFtZSI6ICJhIiwgIm1ldGFkYXRhIjogbnVsbCwgIm5hbWUiOiAiYSIsICJudW1weV90eXBlIjogIm9iamVjdCIsICJwYW5kYXNfdHlwZSI6ICJvYmplY3QifV0sICJjcmVhdG9yIjogeyJsaWJyYXJ5IjogImZhc3RwYXJxdWV0IiwgInZlcnNpb24iOiAiMjAyNC4xMS4wIn0sICJpbmRleF9jb2x1bW5zIjogW3sia2luZCI6ICJyYW5nZSIsICJuYW1lIjogbnVsbCwgInN0YXJ0IjogMCwgInN0ZXAiOiAxLCAic3RvcCI6IDJ9XSwgInBhbmRhc192ZXJzaW9uIjogIjIuMi4zIiwgInBhcnRpdGlvbl9jb2x1bW5zIjogW119ABguZmFzdHBhcnF1ZXQtcHl0aG9uIHZlcnNpb24gMjAyNC4xMS4wIChidWlsZCAwKQBHAgAAUEFSMQ==",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": [
          10,
          20,
          30
         ]
        },
        {
         "a": [
          30,
          20,
          40
         ]
        }
       ],
       "layout": "IPY_MODEL_405ce72438ab4bc3b73cfb7037aac158"
      }
     },
     "631c2dd47d8f4209a65d5c9bec847fd1": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "643e614ccb6b4c4f9bce16d8d092d615": {
      "buffers": [
       {
        "data": "UEFSMRUAFR4VIiwVBBUAFQYVCAAADzgCAAAABAECAAAAAAAAAAAVAhksSAZzY2hlbWEVAgAVABUCFQIYAWEAFgQZHBkcJggcFQAZFQAZGAFhFQIWBBZAFkQZABYIPDYAABkcFQAVABUCAAAAFkAWBAAZHBgGcGFuZGFzGLkDeyJjb2x1bW5faW5kZXhlcyI6IFt7ImZpZWxkX25hbWUiOiBudWxsLCAibWV0YWRhdGEiOiBudWxsLCAibmFtZSI6IG51bGwsICJudW1weV90eXBlIjogIm9iamVjdCIsICJwYW5kYXNfdHlwZSI6ICJtaXhlZC1pbnRlZ2VyIn1dLCAiY29sdW1ucyI6IFt7ImZpZWxkX25hbWUiOiAiYSIsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogImEiLCAibnVtcHlfdHlwZSI6ICJib29sIiwgInBhbmRhc190eXBlIjogImJvb2wifV0sICJjcmVhdG9yIjogeyJsaWJyYXJ5IjogImZhc3RwYXJxdWV0IiwgInZlcnNpb24iOiAiMjAyNC4xMS4wIn0sICJpbmRleF9jb2x1bW5zIjogW3sia2luZCI6ICJyYW5nZSIsICJuYW1lIjogbnVsbCwgInN0YXJ0IjogMCwgInN0ZXAiOiAxLCAic3RvcCI6IDJ9XSwgInBhbmRhc192ZXJzaW9uIjogIjIuMi4zIiwgInBhcnRpdGlvbl9jb2x1bW5zIjogW119ABguZmFzdHBhcnF1ZXQtcHl0aG9uIHZlcnNpb24gMjAyNC4xMS4wIChidWlsZCAwKQBDAgAAUEFSMQ==",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": false
        },
        {
         "a": true
        }
       ],
       "layout": "IPY_MODEL_631c2dd47d8f4209a65d5c9bec847fd1"
      }
     },
     "7e544c6bf4ae47f5a440d9f34186a30f": {
      "buffers": [
       {
        "data": "UEFSMRUAFU4VUCwVBBUAFQYVCAAAJ1ACAAAABAEKAAAAWzEwLDIwLDMwXQcBDjQzMCw0MF0AAAAAAAAAABUCGSxIBnNjaGVtYRUCABUMJQIYAWElJgAWBBkcGRwmCBwVDBkVABkYAWEVAhYEFnAWchkAFgg8NgAAGRwVABUAFQIAAAAWcBYEABkcGAZwYW5kYXMYvQN7ImNvbHVtbl9pbmRleGVzIjogW3siZmllbGRfbmFtZSI6IG51bGwsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogbnVsbCwgIm51bXB5X3R5cGUiOiAib2JqZWN0IiwgInBhbmRhc190eXBlIjogIm1peGVkLWludGVnZXIifV0sICJjb2x1bW5zIjogW3siZmllbGRfbmFtZSI6ICJhIiwgIm1ldGFkYXRhIjogbnVsbCwgIm5hbWUiOiAiYSIsICJudW1weV90eXBlIjogIm9iamVjdCIsICJwYW5kYXNfdHlwZSI6ICJvYmplY3QifV0sICJjcmVhdG9yIjogeyJsaWJyYXJ5IjogImZhc3RwYXJxdWV0IiwgInZlcnNpb24iOiAiMjAyNC4xMS4wIn0sICJpbmRleF9jb2x1bW5zIjogW3sia2luZCI6ICJyYW5nZSIsICJuYW1lIjogbnVsbCwgInN0YXJ0IjogMCwgInN0ZXAiOiAxLCAic3RvcCI6IDJ9XSwgInBhbmRhc192ZXJzaW9uIjogIjIuMi4zIiwgInBhcnRpdGlvbl9jb2x1bW5zIjogW119ABguZmFzdHBhcnF1ZXQtcHl0aG9uIHZlcnNpb24gMjAyNC4xMS4wIChidWlsZCAwKQBHAgAAUEFSMQ==",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": [
          10,
          20,
          30
         ]
        },
        {
         "a": [
          30,
          40
         ]
        }
       ],
       "layout": "IPY_MODEL_46927f70486f4fb7862a2d826b3f356b"
      }
     },
     "80c613b126c9485e977ad12ceb475109": {
      "buffers": [
       {
        "data": "UEFSMRUAFR4VIiwVBBUAFQYVCAAADzgCAAAABAECAAAAAAAAAAAVAhksSAZzY2hlbWEVAgAVABUCFQIYAWEAFgQZHBkcJggcFQAZFQAZGAFhFQIWBBZAFkQZABYIPDYAABkcFQAVABUCAAAAFkAWBAAZHBgGcGFuZGFzGLkDeyJjb2x1bW5faW5kZXhlcyI6IFt7ImZpZWxkX25hbWUiOiBudWxsLCAibWV0YWRhdGEiOiBudWxsLCAibmFtZSI6IG51bGwsICJudW1weV90eXBlIjogIm9iamVjdCIsICJwYW5kYXNfdHlwZSI6ICJtaXhlZC1pbnRlZ2VyIn1dLCAiY29sdW1ucyI6IFt7ImZpZWxkX25hbWUiOiAiYSIsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogImEiLCAibnVtcHlfdHlwZSI6ICJib29sIiwgInBhbmRhc190eXBlIjogImJvb2wifV0sICJjcmVhdG9yIjogeyJsaWJyYXJ5IjogImZhc3RwYXJxdWV0IiwgInZlcnNpb24iOiAiMjAyNC4xMS4wIn0sICJpbmRleF9jb2x1bW5zIjogW3sia2luZCI6ICJyYW5nZSIsICJuYW1lIjogbnVsbCwgInN0YXJ0IjogMCwgInN0ZXAiOiAxLCAic3RvcCI6IDJ9XSwgInBhbmRhc192ZXJzaW9uIjogIjIuMi4zIiwgInBhcnRpdGlvbl9jb2x1bW5zIjogW119ABguZmFzdHBhcnF1ZXQtcHl0aG9uIHZlcnNpb24gMjAyNC4xMS4wIChidWlsZCAwKQBDAgAAUEFSMQ==",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": false
        },
        {
         "a": true
        }
       ],
       "layout": "IPY_MODEL_4c3828c9f5cc461ca72c9e2c7b21c1ba"
      }
     },
     "a254a276c6914cfab434de973e0237aa": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "a5cf8ec5da7743328c9b776812fc1581": {
      "buffers": [
       {
        "data": "UEFSMRUEFSoVLkwVBhUAAAAVUAMAAAAiYSIDAAAAImIiAwAAACJjIhUAFSwVMCwVDBUQFQYVCAAAFlQCAAAADAEIAwABAgABAgAAAAAAAAAAFQIZLEgGc2NoZW1hFQIAFQwlAhgBYSUmABYMGRwZHCYIHBUMGSUAEBkYAWEVAhYMFpIBFpoBGTwYDm51bV9jYXRlZ29yaWVzGAEzABgLbnVtcHlfZHR5cGUYBGludDgAGAtsYWJlbF9kdHlwZRgGb2JqZWN0ABZQJggcNgAAGSwVBBUAFQIAFQAVEBUCAAAAFpIBFgwAGRwYBnBhbmRhcxjjA3siY29sdW1uX2luZGV4ZXMiOiBbeyJmaWVsZF9uYW1lIjogbnVsbCwgIm1ldGFkYXRhIjogbnVsbCwgIm5hbWUiOiBudWxsLCAibnVtcHlfdHlwZSI6ICJvYmplY3QiLCAicGFuZGFzX3R5cGUiOiAibWl4ZWQtaW50ZWdlciJ9XSwgImNvbHVtbnMiOiBbeyJmaWVsZF9uYW1lIjogImEiLCAibWV0YWRhdGEiOiB7Im51bV9jYXRlZ29yaWVzIjogMywgIm9yZGVyZWQiOiBmYWxzZX0sICJuYW1lIjogImEiLCAibnVtcHlfdHlwZSI6ICJpbnQ4IiwgInBhbmRhc190eXBlIjogImNhdGVnb3JpY2FsIn1dLCAiY3JlYXRvciI6IHsibGlicmFyeSI6ICJmYXN0cGFycXVldCIsICJ2ZXJzaW9uIjogIjIwMjQuMTEuMCJ9LCAiaW5kZXhfY29sdW1ucyI6IFt7ImtpbmQiOiAicmFuZ2UiLCAibmFtZSI6IG51bGwsICJzdGFydCI6IDAsICJzdGVwIjogMSwgInN0b3AiOiA2fV0sICJwYW5kYXNfdmVyc2lvbiI6ICIyLjIuMyIsICJwYXJ0aXRpb25fY29sdW1ucyI6IFtdfQAYLmZhc3RwYXJxdWV0LXB5dGhvbiB2ZXJzaW9uIDIwMjQuMTEuMCAoYnVpbGQgMCkAuAIAAFBBUjE=",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": "a"
        },
        {
         "a": "b"
        },
        {
         "a": "c"
        },
        {
         "a": "a"
        },
        {
         "a": "b"
        },
        {
         "a": "c"
        }
       ],
       "layout": "IPY_MODEL_e26add42e4ef46968828c7fc08f32f02"
      }
     },
     "aa8dc28dba5b42c5b90d93e06cb45406": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "b23a2a4e15bc48a7a187fcea6a8a857f": {
      "buffers": [
       {
        "data": "UEFSMRUAFTwVQCwVBBUAFQYVCAAAHnQCAAAABAEw9yizRaMoGAAAuKdCX0UTAAAAAAAAAAAVAhksSAZzY2hlbWEVAgAVBCUCGAFhbIwSHDwAAAAAABYEGRwZHCYIHBUEGRUAGRgBYRUCFgQWXhZiGQAWCDwYCDD3KLNFoygYGAgAALinQl9FExYAABkcFQAVABUCAAAAFl4WBAAZHBgGcGFuZGFzGMcDeyJjb2x1bW5faW5kZXhlcyI6IFt7ImZpZWxkX25hbWUiOiBudWxsLCAibWV0YWRhdGEiOiBudWxsLCAibmFtZSI6IG51bGwsICJudW1weV90eXBlIjogIm9iamVjdCIsICJwYW5kYXNfdHlwZSI6ICJtaXhlZC1pbnRlZ2VyIn1dLCAiY29sdW1ucyI6IFt7ImZpZWxkX25hbWUiOiAiYSIsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogImEiLCAibnVtcHlfdHlwZSI6ICJkYXRldGltZTY0W25zXSIsICJwYW5kYXNfdHlwZSI6ICJkYXRldGltZSJ9XSwgImNyZWF0b3IiOiB7ImxpYnJhcnkiOiAiZmFzdHBhcnF1ZXQiLCAidmVyc2lvbiI6ICIyMDI0LjExLjAifSwgImluZGV4X2NvbHVtbnMiOiBbeyJraW5kIjogInJhbmdlIiwgIm5hbWUiOiBudWxsLCAic3RhcnQiOiAwLCAic3RlcCI6IDEsICJzdG9wIjogMn1dLCAicGFuZGFzX3ZlcnNpb24iOiAiMi4yLjMiLCAicGFydGl0aW9uX2NvbHVtbnMiOiBbXX0AGC5mYXN0cGFycXVldC1weXRob24gdmVyc2lvbiAyMDI0LjExLjAgKGJ1aWxkIDApAGwCAABQQVIx",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": "2025-03-01T09:19:35.732Z"
        },
        {
         "a": "2014-01-02T00:00:00.000Z"
        }
       ],
       "layout": "IPY_MODEL_0248f5a938924d7a8dc882330561f776"
      }
     },
     "ce63d1ac9a0548809f949d1e1198ff25": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "dd6ddb6a5bff404e92e190d43829ff40": {
      "buffers": [
       {
        "data": "UEFSMRUAFXIVYCwVBBUAFQYVCAAAOXACAAAABAESAAAAeyJmb28iOjksImJhciI6MTB9ERkWADMNFiQ1fQAAAAAAAAAAFQIZLEgGc2NoZW1hFQIAFQwlAhgBYSUmABYEGRwZHCYIHBUMGRUAGRgBYRUCFgQWlAEWggEZABYIPDYAABkcFQAVABUCAAAAFpQBFgQAGRwYBnBhbmRhcxi9A3siY29sdW1uX2luZGV4ZXMiOiBbeyJmaWVsZF9uYW1lIjogbnVsbCwgIm1ldGFkYXRhIjogbnVsbCwgIm5hbWUiOiBudWxsLCAibnVtcHlfdHlwZSI6ICJvYmplY3QiLCAicGFuZGFzX3R5cGUiOiAibWl4ZWQtaW50ZWdlciJ9XSwgImNvbHVtbnMiOiBbeyJmaWVsZF9uYW1lIjogImEiLCAibWV0YWRhdGEiOiBudWxsLCAibmFtZSI6ICJhIiwgIm51bXB5X3R5cGUiOiAib2JqZWN0IiwgInBhbmRhc190eXBlIjogIm9iamVjdCJ9XSwgImNyZWF0b3IiOiB7ImxpYnJhcnkiOiAiZmFzdHBhcnF1ZXQiLCAidmVyc2lvbiI6ICIyMDI0LjExLjAifSwgImluZGV4X2NvbHVtbnMiOiBbeyJraW5kIjogInJhbmdlIiwgIm5hbWUiOiBudWxsLCAic3RhcnQiOiAwLCAic3RlcCI6IDEsICJzdG9wIjogMn1dLCAicGFuZGFzX3ZlcnNpb24iOiAiMi4yLjMiLCAicGFydGl0aW9uX2NvbHVtbnMiOiBbXX0AGC5mYXN0cGFycXVldC1weXRob24gdmVyc2lvbiAyMDI0LjExLjAgKGJ1aWxkIDApAEoCAABQQVIx",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": {
          "bar": 10,
          "foo": 9
         }
        },
        {
         "a": {
          "bar": 5,
          "foo": 3
         }
        }
       ],
       "layout": "IPY_MODEL_ce63d1ac9a0548809f949d1e1198ff25"
      }
     },
     "e26add42e4ef46968828c7fc08f32f02": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "e832fe180b6a460db8b7495717d3892d": {
      "buffers": [
       {
        "data": "UEFSMRUAFVoVXiwVBhUAFQYVCAAALbACAAAABgEKAAAAImEgc3RyaW5nIgQAAAB0cnVlBQAAAGZhbHNlAAAAAAAAAAAVAhksSAZzY2hlbWEVAgAVDCUCGAFhJSYAFgYZHBkcJggcFQwZFQAZGAFhFQIWBhZ8FoABGQAWCDw2AAAZHBUAFQAVAgAAABZ8FgYAGRwYBnBhbmRhcxi9A3siY29sdW1uX2luZGV4ZXMiOiBbeyJmaWVsZF9uYW1lIjogbnVsbCwgIm1ldGFkYXRhIjogbnVsbCwgIm5hbWUiOiBudWxsLCAibnVtcHlfdHlwZSI6ICJvYmplY3QiLCAicGFuZGFzX3R5cGUiOiAibWl4ZWQtaW50ZWdlciJ9XSwgImNvbHVtbnMiOiBbeyJmaWVsZF9uYW1lIjogImEiLCAibWV0YWRhdGEiOiBudWxsLCAibmFtZSI6ICJhIiwgIm51bXB5X3R5cGUiOiAib2JqZWN0IiwgInBhbmRhc190eXBlIjogIm9iamVjdCJ9XSwgImNyZWF0b3IiOiB7ImxpYnJhcnkiOiAiZmFzdHBhcnF1ZXQiLCAidmVyc2lvbiI6ICIyMDI0LjExLjAifSwgImluZGV4X2NvbHVtbnMiOiBbeyJraW5kIjogInJhbmdlIiwgIm5hbWUiOiBudWxsLCAic3RhcnQiOiAwLCAic3RlcCI6IDEsICJzdG9wIjogM31dLCAicGFuZGFzX3ZlcnNpb24iOiAiMi4yLjMiLCAicGFydGl0aW9uX2NvbHVtbnMiOiBbXX0AGC5mYXN0cGFycXVldC1weXRob24gdmVyc2lvbiAyMDI0LjExLjAgKGJ1aWxkIDApAEgCAABQQVIx",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": "a string"
        },
        {
         "a": true
        },
        {
         "a": false
        }
       ],
       "layout": "IPY_MODEL_a254a276c6914cfab434de973e0237aa"
      }
     },
     "ec6bc3c50a994d59ba15002f17037e9f": {
      "buffers": [
       {
        "data": "UEFSMRUAFXIVaCwVBBUAFQYVCAAAOXACAAAABAESAAAAeyJmb28iOjksInF1eCI6MTB9ERkWRDMsImJhciI6NX0AAAAAAAAAABUCGSxIBnNjaGVtYRUCABUMJQIYAWElJgAWBBkcGRwmCBwVDBkVABkYAWEVAhYEFpQBFooBGQAWCDw2AAAZHBUAFQAVAgAAABaUARYEABkcGAZwYW5kYXMYvQN7ImNvbHVtbl9pbmRleGVzIjogW3siZmllbGRfbmFtZSI6IG51bGwsICJtZXRhZGF0YSI6IG51bGwsICJuYW1lIjogbnVsbCwgIm51bXB5X3R5cGUiOiAib2JqZWN0IiwgInBhbmRhc190eXBlIjogIm1peGVkLWludGVnZXIifV0sICJjb2x1bW5zIjogW3siZmllbGRfbmFtZSI6ICJhIiwgIm1ldGFkYXRhIjogbnVsbCwgIm5hbWUiOiAiYSIsICJudW1weV90eXBlIjogIm9iamVjdCIsICJwYW5kYXNfdHlwZSI6ICJvYmplY3QifV0sICJjcmVhdG9yIjogeyJsaWJyYXJ5IjogImZhc3RwYXJxdWV0IiwgInZlcnNpb24iOiAiMjAyNC4xMS4wIn0sICJpbmRleF9jb2x1bW5zIjogW3sia2luZCI6ICJyYW5nZSIsICJuYW1lIjogbnVsbCwgInN0YXJ0IjogMCwgInN0ZXAiOiAxLCAic3RvcCI6IDJ9XSwgInBhbmRhc192ZXJzaW9uIjogIjIuMi4zIiwgInBhcnRpdGlvbl9jb2x1bW5zIjogW119ABguZmFzdHBhcnF1ZXQtcHl0aG9uIHZlcnNpb24gMjAyNC4xMS4wIChidWlsZCAwKQBKAgAAUEFSMQ==",
        "encoding": "base64",
        "path": [
         "df_parquet"
        ]
       }
      ],
      "model_module": "anywidget",
      "model_module_version": "~0.9.*",
      "model_name": "AnyModel",
      "state": {
       "_anywidget_id": "__main__.SerializationWidget",
       "_esm": "\n    import * as hyparquet from \"https://cdn.jsdelivr.net/npm/hyparquet@1.8.4/+esm\";\n    function render({ model, el }) {\n      console.log(\"hyparquet\", hyparquet)\n\n        const table_bytes = model.get(\"df_parquet\")\n        console.log(\"table_bytes\", table_bytes.length, table_bytes)\n        const metadata = hyparquet.parquetMetadata(table_bytes.buffer)\n        console.log(\"metadata\", metadata)\n        hyparquet.parquetRead({\n            file: table_bytes.buffer,\n            metadata:metadata,\n            rowFormat: 'object',\n            onComplete: data => {\n                const parqData = data;\n                console.log(\"parqData\", parqData)\n                model.set(\"df_json\", data)\n                model.save_changes();\n            }\n      })\n    }\n    export default { render };\n    ",
       "_model_module": "anywidget",
       "_model_module_version": "~0.9.*",
       "_model_name": "AnyModel",
       "_view_module": "anywidget",
       "_view_module_version": "~0.9.*",
       "_view_name": "AnyView",
       "df_json": [
        {
         "a": {
          "foo": 9,
          "qux": 10
         }
        },
        {
         "a": {
          "bar": 5,
          "foo": 3
         }
        }
       ],
       "layout": "IPY_MODEL_4c9e32ab556d4753b437dcd4d249445d"
      }
     }
    },
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
